package com.centaline.androidsalesblog.utils;

import android.view.View;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;

/**
 * Created by lihq22 on 2016/3/2.
 */
public class AnimationUtil {

    /**
     * 箭头向下旋转动画
     *
     * @param duration 设置动画持续时间
     * @param fillafter 动画执行完后是否停留在执行完的状态
     * @param startoffst 执行前的等待时间
     */
    public static void Rotate(View view, long duration, boolean fillafter, long startoffst,float startAngle,float endAngle) {
        final RotateAnimation animation = new RotateAnimation(startAngle, endAngle, Animation.RELATIVE_TO_SELF,
                0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        animation.setDuration(duration);
        animation.setFillAfter(fillafter);
        animation.setStartOffset(startoffst);

        view.setAnimation(animation);
        animation.startNow();
    }


}
